<html>
<head>
<title> Przeglądaj swoje dane </title>
<META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=utf-8">
<script type="text/javascript">
function altRows(id){
	if(document.getElementsByTagName){  
		
		var table = document.getElementById(id);  
		var rows = table.getElementsByTagName("tr"); 
		 
		for(i = 0; i < rows.length; i++){          
			if(i % 2 == 0){
				rows[i].className = "evenrowcolor";
			}else{
				rows[i].className = "oddrowcolor";
			}      
		}
	}
}
window.onload=function(){
	altRows('alternatecolor');
}
</script>
<link href="table.css" rel="stylesheet" type="text/css" />
</head>
<body>
<center><table border=2 class="altrowstable" id="alternatecolor">
<tr>
<?php 
include 'session.php';
include('laczenie_baza.php');
$user = $_SESSION['zalogowany'];
$query="SELECT * FROM user WHERE email='$user'";
$result = mysql_query($query,$link);
$r = mysql_fetch_array($result);
echo "<h1>Twoje dane: </h1><br><br>";
echo "<tr><td>Email: </td>"."<td>".$_SESSION['email'] = $r[1]."</td></tr>";
echo "<tr><td>Imię: </td>"."<td>".$_SESSION['imie'] = $r[4]."</td></tr>";
echo "<tr><td>Nazwisko: </td>"."<td>".$_SESSION['nazwisko'] = $r[5]."</td></tr>";
echo "<tr><td>PESEL: </td>"."<td>".$_SESSION['pesel'] = $r[6]."</td></tr>";
echo "<tr><td>Ulica: </td>"."<td>".$_SESSION['ulica'] = $r[7]."</td></tr>";
echo "<tr><td>Nr domu: </td>"."<td>".$_SESSION['nr_domu'] = $r[8]."</td></tr>";
echo "<tr><td>Kod pocztowy: </td>"."<td>".$_SESSION['kod'] = $r[9]."</td></tr>";
echo "<tr><td>Miasto: </td>"."<td>".$_SESSION['miasto'] = $r[10]."</td></tr>";
echo "<tr><td>Telefon: </td>"."<td>".$_SESSION['telefon'] = $r[11]."</td></tr>";
echo "<tr><td>Pytanie do hasła: </td>"."<td>".$_SESSION['pytanie'] = $r[12]."</td></tr>";
echo "<tr><td>Odpowiedz: </td>"."<td>".$_SESSION['odpowiedz'] = $r[13]."</td></tr>";
echo "<tr><td>Uwagi: </td>"."<td>".$_SESSION['uwagi'] = $r[14]."</td></tr>";
?>
</tr>
</table>
<br><br>Chcesz modyfikować swoje dane?<br>
<h4>
<a href="user_change.php" style="color: #696; text-decoration: none; background-color: transparent">Tak.</a><br>
<a href="change_pass.php" style="color: #696; text-decoration: none; background-color: transparent">Zmiana hasła</a></center>
</h4>
<br>

</body>
</html>